#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int sum = 0;
    int N = 0;
    int M = 0;
    scanf("%d %d", &N, &M);
    int arr[10][10];

    for (int i = 0; i < N; i++)
    {

        for (int j = 0; j < M; j++)
        {
            scanf("%d ", &arr[i][j]);
            if (arr[i][j] > 0)
            {
                sum = sum + arr[i][j];
            }
        }

    }

    printf("%d", sum);

    return 0;
}